﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html;charset=utf-8;" />

<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/inform.css"/>

<script type="text/javascript" src="__PUBLIC__/js/jquery-1.11.0.min.js" ></script>



<script type="text/javascript">
$(function(){

	$('#ques1,#ques2').change(function(){	
		if($(this).val()==9){
			$(this).parents('li').next('.sq_custome_ques').show();		
		}else{
			$(this).parents('li').next('.sq_custome_ques').hide();		
		
		}
	})
		  $(document).keypress(function(e) { 
          // 回车键事件 
		   if(e.which == 13) { 
				$('.mp_btn_sure').trigger("click");
		   } 
         }); 	
	$('.mp_btn_sure').click(function(){
	
		ans1 = $('.ans1').val();
		ans2 = $('.ans2').val();
		from =$('.from').val();
	
			
		  $.ajax({
             type: "POST",
             url: "{:U('setquestionCheck')}",
			 data: {from:from,ans1:ans1,ans2:ans2},
			 dataType: "json",
             success: function(data){
				if(data==1){
					message = "请回答密保问题1";
					 alert(message);
				}else if(data==2){
					message = "请回答密保问题2";
					 alert(message);
				}else if(data==3){
					message = "问题1答案错误";
					 alert(message);
				}else if(data==4){
					message = "问题2答案错误";
					 alert(message);
				}else if(data==5){
					window.location.href="{:U('question')}"
				}
				
									}
			})		
		
	})
	

})

</script>
</head>

<body>
<div class="main_wrap">
<div class="zt" id="zt">
	<include file="Public/leftMenu" />
	
	<div class="yinfor">
		<div class="center_wrap">
			<div class="center_title"><h1>账户安全</h1></div>
			<p class="lr_title">密保验证</p>

			<div class="sq_wrap">

				<div class="sq_main" style="position:relative;left:-80px;">
					<form name="sq_form">
					<input type="hidden" name="from" class="from" value="1" />
					<ul>
						<li>
							<div class="sq_atitle">密保问题1：</div>
							<div class="sq_answears">{$q1}</div>
						</li>
					
						<li>
							<div class="sq_atitle">密保答案1：</div>
							<div class="sq_answears">
								<input type="text" name="ans1" class="ans1" />
							</div>
						</li>			
					</ul>
					<ul>
						<li>
							<div class="sq_atitle">密保问题2：</div>
							<div class="sq_answears">{$q2}</div>
						</li>
					
						<li>
							<div class="sq_atitle">密保答案2：</div>
							<div class="sq_answears">
								<input type="text" name="ans2" class="ans2" />
							</div>
						</li>	

						
					</ul>	
					</form>
					<div class="mp_sure"><input type="button" class="mp_btn_sure" value="确   定"/></div>
				</div>
				

				<div class="mp_menu2 sq_footer">
					<p class="sq_tip">温馨提示</p>
					<ul class="sq_tipinfor">
						<li>1、密码保护功能可以保障您登录的安全，当密码发生问题时，帮您方便快捷的取回新密码。</li>
						<li>2、请您认真填写密码保护问题及答案，并且记住密码保护问题及答案，否则密码丢失，将无法取回。</li>
					</ul>

				</div>
			</div>
		</div>
	</div>

</div>
</div>

</body>

</html>